# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sirius Bakke <sirius\at/nonline.org>

pkgname=pam_mount
pkgver=2.19
pkgrel=2
pkgdesc='A PAM module that can mount volumes for a user session'
arch=(loong64 x86_64)
url='http://pam-mount.sourceforge.net/'
license=(GPL)
depends=(pcre2 util-linux libhx libxml2 cryptsetup)
backup=('etc/security/pam_mount.conf.xml')
options=(!emptydirs)
source=(https://downloads.sourceforge.net/project/pam-mount/$pkgname/$pkgname-$pkgver.tar{.xz,.asc})
sha256sums=('6b6362b2758628eba9768eee4d934ee36ac0e343f0769f4cf7623fd809e0a60a'
            'SKIP')
validpgpkeys=(2F8BFE96D14F8B560FBC1F1DA28BDFEEB5A2B2FF  # Jan Engelhardt <jengelh@inai.de>
              23686C10A45691BE7A425109D6388181F35A0938
              BCA0C5C309CAC569E74A921CF76EFE5D0C223A8F)              

build() {
  cd $pkgname-$pkgver
  ./configure \
	--prefix=/usr \
	--with-ssbindir=/usr/bin \
	--sbindir=/usr/bin \
	--with-slibdir=/usr/lib \
	--sysconfdir=/etc \
	--localstatedir=/var
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool # Fix overlinking
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
